<template>
  <div class="index">
    <img class="i-background" :src="prefixOssUrl('background.png')" />
    <div class="i-logo">
      <img class="i-logo-img" :src="prefixOssUrl('logo.png')" alt="" />
    </div>
    <div class="i-menu">
      <div
        class="m-item"
        :key="item.name"
        @click="navigation(item.path)"
      >
        <img class="m-item_img" :src="prefixOssUrl(item.imgUrl)" />
        <p class="m-item_name">{{ item.name }}</p>
      </div>
    </div>
    <div class="i-footer">
      <div class="f-link-service">
        <span class="s-icon iconfont icon-kefu"></span>技术客服
      </div>
      <div class="f-online-time">在线时间：（08:00-18:00）</div>
    </div>
  </div>
</template>

<script setup>
import { inject } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();

const { prefixOssUrl } = inject("globalMethods");
const menu = [
  {
    imgUrl: "menu/retail.png",
    name: "订单收银",
    path: "/retail",
  },
  {
    imgUrl: "menu/orderLog.png",
    name: "订单记录",
    path: "/order",
  },
  {
    imgUrl: "menu/member.png",
    name: "会员管理",
    path: "/member",
  },
  {
    imgUrl: "menu/reward.png",
    name: "奖励查询",
    path: "/reward",
  },
  {
    imgUrl: "menu/finance.png",
    name: "营业报表",
    path: "/finance",
  },
  {
    imgUrl: "menu/exchange.png",
    name: "店主换货",
    path: "",
  },
  {
    imgUrl: "menu/stock.png",
    name: "库房管理",
    path: "/stock",
  },
  {
    imgUrl: "menu/activities.png",
    name: "营销活动",
    path: "",
  },
  {
    imgUrl: "menu/setting.png",
    name: "系统设置",
    path: "/setting",
  },
];
const navigation = (e) => {
  router.push({ path: e });
};
</script>

<style lang="less" scoped>
.index {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  .i-background {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
  }
  .i-logo {
    width: 336px;
    height: 178px;

    &-img {
      width: 100%;
      height: 100%;
    }
  }

  .i-menu {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    width: 1600px;
    margin-top: 30px;

    .m-item {
      display: flex;
      flex-direction: column;
      justify-items: center;
      margin: 0 57px;

      &_img {
        width: 200px;
        height: 200px;
        border-radius: 66px;
      }

      &_name {
        height: 34px;
        margin-top: 20px;
        font-size: 36px;
        font-weight: 500;
        color: #fff;
        text-align: center;
      }
    }
  }

  .i-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 90px;
    width: 100%;

    .f-link-service {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 200px;
      height: 56px;
      margin-right: 38px;
      font-size: 28px;
      color: #dddee2;
      border: 2px solid #4f5263;
      border-radius: 5px;

      .s-icon {
        height: 56px;
        margin-right: 5px;
        font-size: 36px;
        line-height: 60px;
      }

      .s-text {
        height: 56px;
        font-size: 28px;
        line-height: 56px;
      }
    }

    .f-online-time {
      height: 29px;
      margin-right: 193px;
      font-size: 30px;
      color: #dddee2;
      line-height: 29px;
    }
  }
}
</style>
